{include file="file:$theme_global/_header.tpl"}	
<div class="title">			
	<h1>Manage Images</h1>
{*
	{if $loggedInUsername eq $user.username}
	<a href="/user/uploadimage" title="Upload New Image" class="more">Upload New Image</a>			
	{/if}
*}
</div>
<div id="sub">
	{include file="file:$theme_global/_user_image.tpl"}
	<div class="sub">
		{include file="file:$theme_global/_user_nav.tpl"}
	</div>
</div>
<div id="main">
	<div class="main">
		{if count($media) gt 0}
			{if $loggedInUsername eq $user.username}
			<div class="sec">
				<div class="inner">
					<p class="alt">Click an image below to edit the caption or set as your profile image</p>
				</div>
			</div>
			<ul class="thumbs">
				{foreach from=$media item=image}
				<li>
					{if $loggedInUsername eq $user.username}
					<a href="/user/editimage/id/{$image.id}" title="Edit Image">
						<img src="{$image.thumb_image_url}" width="78" height="78" alt="" />
					</a>
					{else}
						<a href="{$image.full_image_url}" title="{$image.caption}" rel="lightboximageset"><img src="{$image.thumb_image_url}" width="78" height="78" alt="" /><span></span></a>
					{/if}
				</li>
				{/foreach}
			</ul>
			{else}
			<div class="title">
				<h2>{$pagetitle}</h2>
				{if $loggedInUsername eq $user.username}
				<a href="/user/uploadimage" title="Upload New Image" class="more">Upload New Image</a>			
				{/if}
			</div>
			<ul class="thumbs">	
				{foreach from=$media item=image}
				<li>
					{if $loggedInUsername eq $user.username}
					<a href="/user/editimage/id/{$image.id}" title="Edit Image">	
						<img src="{$image.thumb_image_url}" width="78" height="78" alt="" />
					</a>
					{else}
						<a href="{$image.full_image_url}" title="{$image.caption}" rel="lightboximageset"><img src="{$image.thumb_image_url}" width="78" height="78" alt="" /><span></span></a>						
					{/if}
				</li>
				{/foreach}
			</ul>
			{/if}
		{else}
		<div class="sec">
			<div class="title">
				<h2>{$pagetitle}</h2>
				{if $loggedInUsername eq $user.username}
				<a href="/user/uploadimage" title="Upload New Image" class="more">Upload New Image</a>			
				{/if}
			</div>
			<div class="inner">
				<p class="alt">There are currently no images.</p>
			</div>
		</div>
		{/if}
	</div>
</div>
{include file="file:$theme_global/_footer.tpl"}